//
//  MainController.m
//  remember
//
//  Created by Kim Dong Hoon on 09. 11. 28..
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "MainController.h"

@implementation MainViewController

-(id) init
{
	if(self = [super init])
	{
//		self.title = [[[ NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
		
		self.title = @"영어 단어 외우기";
		
	}
	return self;
}

-(void) loadView
{
	UIView* contentView = [[UIImageView alloc] initWithFrame: [[UIScreen mainScreen] applicationFrame]];
//	[contentView setImage: [UIImage imageNamed: @"apple.jpg"]];

	contentView.autoresizesSubviews = YES;
	contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
	
	contentView.backgroundColor = [UIColor whiteColor];
	self.view = contentView;
	[contentView release];

	// 네비케이션 색깔 바꾸기
	self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
	
	// 네비게이션 오른쪽에 버튼 추가하기 
	self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"빨강" style: UIBarButtonItemStylePlain 
																			 target:self action: @selector(goRed)] autorelease];
	
	
	self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"파랑" style: UIBarButtonItemStylePlain 
																						target:self action: @selector(goBule)] autorelease];
}

-(void) goRed
{

//	UIImageView* redView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
	
	self.view.backgroundColor = [UIColor colorWithRed:1.0f green:0.45f blue:0.45f alpha:1.0f];
//	[redView release];
}

-(void) goBule
{
	self.view.backgroundColor = [UIColor colorWithRed:0.45f	green:0.45f blue:1.0f alpha:1.0f];
}

-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
	return YES;
}

-(void) didReceiveMemoryWarning
{
	[super didReceiveMemoryWarning];
}

-(void) dealloc
{
	[super dealloc];
}

@end
